﻿using System;
using System.Data.SqlClient;

namespace VegetableSale.NET.Utils
{
	public class DBConnection
	{
        private static String Database = "management";
        private static String Username = "root";
        private static String Password = "20010509";


        // private ISessionFactory _sessionFactory;
        private string ConnectString = "server=.;database=management;uid=" + Username + ";pwd=" + Password;
        private SqlConnection SqlConnection;
        public DBConnection()
        {
            SqlConnection = new SqlConnection(ConnectString);
        }

        public SqlConnection GetConnection()
        {
            SqlConnection.Open();
            return SqlConnection;
        }

        public void Close(SqlConnection connection)
        {
            connection.Close();
        }
    }
}

